package com.springboot.show_web.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by yaosheng on 2019/11/9.
 * Servlet的注册类
 */
public class MyServlet extends HttpServlet {

    //处理Get请求
    @Override
    protected void doGet(HttpServletRequest rep, HttpServletResponse resp) throws ServletException, IOException {
        doGet (rep, resp);
    }

    @Override
    protected void doPost(HttpServletRequest rep, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter ().write ("Hello MyServlet");
    }

}